import java.util.*;

public class Test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            String s1 = in.nextLine();//应该输入的
            String s2 = in.nextLine();//实际输入的
            func(s1,s2);
        }
    }
    public static void func(String s1,String s2) {
        HashSet<Character> set1 = new HashSet<>();
        HashSet<Character> set2 = new HashSet<>();
        for (char ch:s2.toUpperCase().toCharArray()) {
                set1.add(ch);
            }
        for (char ch:s1.toUpperCase().toCharArray()) {
            if (!set1.contains(ch) && !set2.contains(ch)) {
                System.out.print(ch);
                set2.add(ch);
            }
        }
    }
    public List<String> topKFrequent(String[] words, int k) {
        //统计次数
        Map<String,Integer> map = new HashMap<>();
        for (String word: words) {
            if(map.get(word) == null) {
                map.put(word,1);
            }else {
                int val = map.get(word);
                map.put(word,val+1);
            }
        }
        //创建小根堆
        PriorityQueue<Map.Entry<String,Integer>> minHeap =
                new PriorityQueue<>(new Comparator<Map.Entry<String, Integer>>() {
                    @Override
                    public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
                        if (o1.getValue().compareTo(o2.getValue()) == 0) {
                            return o2.getKey().compareTo(o1.getKey());
                        }
                        return o1.getValue().compareTo(o2.getValue());
                    }
                });
        //遍历map
        for (Map.Entry<String,Integer> entry:map.entrySet()) {
            //数量不足插入k个
            if (minHeap.size() < k) {
                minHeap.offer(entry);
            }else {
                //次数相同
                Map.Entry<String,Integer> top = minHeap.poll();
                if(top.getValue().compareTo(entry.getValue()) == 0) {
                    //比较字典序
                    if (top.getKey().compareTo(entry.getKey()) > 0) {
                        //出堆
                        minHeap.poll();
                        minHeap.offer(entry);
                    }else {
                        //次数不同
                        if (entry.getValue().compareTo(top.getValue()) > 0) {
                            minHeap.poll();
                            minHeap.offer(entry);
                        }
                    }
                }
            }
        }
        List<String> ans = new ArrayList<>();
        for (int i = 0; i < k; i++) {
            Map.Entry<String,Integer> tmp =  minHeap.poll();
            ans.add(tmp.getKey());
        }
        Collections.reverse(ans);
        return ans;
    }
}
